diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-12-11 00:49:43 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-12-11 00:50:50 +0000 |
| commit | 082e7a06ed147d3bce1116d48b0911119b43af71 (patch) | |
| tree | a5d484c552241391e8d48a81d77a803a531b5ca1 /snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected | |
| parent | 1b56846cfdf7e25408920bdeb4f46edb721a218f (diff) | |
Compile Patio code for positional structs
Diffstat (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected')
1 files changed, 83 insertions, 0 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..60808ec5 --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,83 @@ +Compilation unit elements: + +( + function-decl + "shed__runtime__gc_get_root_stack_index" + params=() + return-type=int +) +( + function-decl + "shed__runtime__gc_alloc" + params=((param "size" int) (param "runtime_type_tag" int32)) + return-type=data-ptr +) +( + function + "shed__function__User__0" + visibility=private + locals=((param "closurePointer__0" data-ptr) (param "local__isActive" int) (param "local__name" int) (val "gcRootStackIndex__0" int) (val "structValuePointer__0" data-ptr) (val "structValue__0" int)) + return-type=int + body=( + (call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ()) + (call (local "structValuePointer__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (int int)))))) (int32-const 1))) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 0) + value=(int-const 0) + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 1) + value=(int-const 0) + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(0 2) + value=(int-const 1) + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 0) + value=(local "local__name") + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 1) + value=(local "local__isActive") + ) + (data-ptr-to-int (local "structValue__0") (local "structValuePointer__0")) + (return (local "structValue__0")) + ) +) + +Locals: + * (val "structType__User__0" int) + * (val "closurePointer__User__0" data-ptr) + +Instructions: + +( + (call (local "closurePointer__User__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))))) (int32-const 2))) + ( + memory-store + pointer=(local "closurePointer__User__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))) + offset=(1 0) + value=(function-ptr-const "shed__function__User__0") + ) + (data-ptr-to-int (local "structType__User__0") (local "closurePointer__User__0")) +) + +Temporary stack: + * PatioLocalRef[name=structType__User__0] |
